Reference for Bava Metzia 64:16
ת"ש אוהב לפרוק ושונא לטעון מצוה בשונא כדי לכוף את יצרו ואי סלקא דעתך צער בעלי חיים דאורייתא הא עדיף ליה אפ"ה כדי לכוף את יצרו עדיף
But if you say that [relieving] the suffering of an animal is Biblically enjoined, why mayest thou forbear: surely 'thou shalt surely help with him' is applicable! — After all, [relieving] the suffering of an animal is Biblically [enjoined]: the reference there is to loading. If so, consider the second clause: In the case of an animal belonging to an Israelite and a load belonging to a heathen, 'thou shalt surely help.' But if this treats of loading, why [apply] 'thou shalt surely help him'? — On account of the inconvenience of the Israelite.<span class="x" onmousemove="('comment',' Who is forced to stay with the animal until it is laden and able to proceed. ');"><sup>14</sup></span>